home *** CD-ROM | disk | FTP | other *** search
- Path: beavis.kronos.com!usenet
- From: lipsett@kronos.com (Roger Lipsett)
- Newsgroups: comp.lang.c++
- Subject: Derivation and protected members
- Date: 30 Jan 1996 13:57:37 GMT
- Organization: Kronos, Inc.
- Message-ID: <4el84h$t86@beavis.kronos.com>
- NNTP-Posting-Host: 158.228.13.99
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-Newsreader: WinVN 0.99.7
-
- Suppose I have a base class, bas, and a derived class, der, of which bas is a
- public base. der has additional data members beyond those provided by bas. All
- data members of both classes are protected.
-
- I wish to define an operation (=) that will assign an instance of bas to an
- instance of der by setting all of der's data members that are inherited from
- bas to the values as provided by the instance of bas, and leaving untouched
- the other data members of der..
-
- There appears to be no simple way to do this. The der-instance does not have
- access to the protected members of the bas-instance, as those members are
- protected. What am I missing here?
-
- Thanks in advance,
- Roger Lipsett
- Kronos, Inc.
- 400 Fifth Ave.
- Waltham MA 02154
-
- internet: lipsett@kronos.com
- phone: (617) 487-4776
-
-
-